package com.lm.hutool.example;

import cn.hutool.core.util.ReUtil;

import java.util.List;

public class HutoolRegexExample {
    public static void main(String[] args) {
        String content = "Java、Python、C++、JavaScript";

        // 匹配所有单词
        List<String> words = ReUtil.findAll("[a-zA-Z]+", content, 0);
        System.out.println("匹配到的单词：" + words);

        // 替换匹配项
        String replaced = ReUtil.replaceAll(content, "Java", "Go");
        System.out.println("替换后的内容：" + replaced);
    }
}
